********************************************************************************
* Do External Threats Reduce Affective Polarization? An Experiment on Russia's Invasion of Ukraine 
* ONLINE APPENDIX
* BY JONAS PILGAARD KAISER & MARKUS SEIER
********************************************************************************

*Replicators should set directory to open data
global path "your_path_here"
cd "$path"

*Start logging
log using "Replication_Appendix_Log.log", text replace

*Creates folders
cap mkdir "Figures/Appendix"
cap mkdir "Tables/Appendix"

clear all

use "Data_Clean.dta"

*Define controls 
glo controls1 "Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed"
glo controls2 "Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed Political_Interest StrongSupporter Democrat"
glo controls1_logit "Age i.Male i.Ethnicitydum1 i.Ethnicitydum2 i.Ethnicitydum3 i.Ethnicitydum4 i.Schoolingdum1 i.Schoolingdum3 i.Schoolingdum4 i.Schoolingdum5 i.Schoolingdum6 i.Schoolingdum7 i.Employed"
glo controls2_logit "Age i.Male i.Ethnicitydum1 i.Ethnicitydum2 i.Ethnicitydum3 i.Ethnicitydum4 i.Schoolingdum1 i.Schoolingdum3 i.Schoolingdum4 i.Schoolingdum5 i.Schoolingdum6 i.Schoolingdum7 i.Employed Political_Interest i.StrongSupporter i.Democrat"

********************************************************************************
*** TABLE A.1
********************************************************************************

* Collect summary statistics (note that table has been manually created in latex)
estpost tabstat Age Male Asian_American Black Hispanic Other_Ethnicity White ///
    Employed Self_Employed Student Retired Other_Employment Less_Than_HS ///
    High_School Some_College Associate_Degree Bachelors_Degree Masters_Degree ///
    Doctorate Durationinseconds Q_RelevantIDFraudScore Prolific_Score ///
    Democrat Republican StrongSupporter Political_Interest, ///
    statistics(N mean sd min max) columns(stat)

********************************************************************************
*** FIGURE A.2
********************************************************************************

*Generate temp. variables for plot
gen run=_n
gen x=1 if run<235 
replace x=2 if run>=235 & run<470
replace x=3 if run>=470 & run<705
replace x=5 if run>=705 & run<940
replace x=6 if run>=940 & run<1175
replace x=7 if run>=1175

*Manually generate numbers for the bars
gen m_inv=.
gen hi_inv=.
gen li_inv=.
replace m_inv=3.522976 if x==1
replace hi_inv=m_inv+invttail(457-1,0.025)*(1.057563/sqrt(457)) if x==1
replace li_inv=m_inv-invttail(457-1,0.025)*(1.057563/sqrt(457)) if x==1
replace m_inv=2.912473 if x==5
replace hi_inv=m_inv+invttail(457-1,0.025)*(1.082657/sqrt(457)) if x==5
replace li_inv=m_inv-invttail(457-1,0.025)*(1.082657/sqrt(457)) if x==5
gen m_con=.
gen hi_con=.
gen li_con=.
replace m_con=3.328452 if x==2
replace hi_con=m_con+invttail(478-1,0.025)*(1.053529/sqrt(478)) if x==2
replace li_con=m_con-invttail(478-1,0.025)*(1.053529/sqrt(478)) if x==2
replace m_con=2.89749 if x==6
replace hi_con=m_con+invttail(478-1,0.025)*(1.098863/sqrt(478)) if x==6
replace li_con=m_con-invttail(478-1,0.025)*(1.098863/sqrt(478)) if x==6
gen m_dis=.
gen hi_dis=.
gen li_dis=.
replace m_dis=3.415094 if x==3
replace hi_dis=m_dis+invttail(477-1,0.025)*(1.064921/sqrt(477)) if x==3
replace li_dis=m_dis-invttail(477-1,0.025)*(1.064921/sqrt(477)) if x==3
replace m_dis=3.289308 if x==7
replace hi_dis=m_dis+invttail(477-1,0.025)*(1.157797/sqrt(477)) if x==7
replace li_dis=m_dis-invttail(477-1,0.025)*(1.157797/sqrt(477)) if x==7

*Produce and save the graph
graph twoway (bar m_inv x, color(red*1.2)) (rcap hi_inv li_inv x, color(black)) (bar m_con x, color(gs8)) (rcap hi_con li_con x, color(black)) (bar m_dis x, color(sand)) (rcap hi_dis li_dis x, color(black)), xlabel(2 "Threat Perception" 6 "Disagreement Perception") xscale(noline) xtitle("") ylabel(1(0.5)5) yscale(range(1 5)) legend(order(1 "Invasion" 3 "Control" 5 "Disagreement"))
graph export Figures/Appendix/figA2.eps, replace

*Drop temp. variables 
drop run x m_inv hi_inv li_inv m_con hi_con li_con m_dis hi_dis li_dis

********************************************************************************
*** TABLE A.2
********************************************************************************

*Generate and export input for Table A.2 (note that table has been manually adjusted in latex)

tab P1_Type, freq
tabout P1_Type using Tables/Appendix/TableA2_1.tex, replace style(tex) clab(%)

tab P1_Type Democrat, chi col
tabout P1_Type Democrat using Tables/Appendix/TableA2_2.tex, replace style(tex) clab(%) 

********************************************************************************
*** TABLE A.3
********************************************************************************

*Note that the regression outputs are combined manually in latex. Outputs saved to the table output folder contain the coefficient estimates included in the paper table. 

*Estimate and store column 1 (top panel) regression
logit P1_InParty i.Invasion_Condition if Disagreement_Condition==0 , robust
margins, dydx(Invasion_Condition) atmeans post
eststo logit_InParty_H1_1
*Estimate and store column 2 (top panel) regression
logit P1_InParty i.Invasion_Condition $controls1_logit if Disagreement_Condition==0 , robust
margins, dydx(Invasion_Condition) atmeans post
eststo logit_InParty_H1_2
*Estimate and store column 3 (top panel) regression
logit P1_InParty i.Invasion_Condition $controls2_logit if Disagreement_Condition==0 , robust
margins, dydx(Invasion_Condition) atmeans post
eststo logit_InParty_H1_3
*Estimate and store column 4 (top panel) regression
logit P1_OutParty i.Invasion_Condition if Disagreement_Condition==0 , robust
margins, dydx(Invasion_Condition) atmeans post
eststo logit_OutParty_H1_1
*Estimate and store column 5 (top panel) regression
logit P1_OutParty i.Invasion_Condition $controls1_logit if Disagreement_Condition==0 , robust
margins, dydx(Invasion_Condition) atmeans post
eststo logit_OutParty_H1_2
*Estimate and store column 6 (top panel) regression
logit P1_OutParty i.Invasion_Condition $controls2_logit if Disagreement_Condition==0 , robust
margins, dydx(Invasion_Condition) atmeans post
eststo logit_OutParty_H1_3

*Combine regression outputs and export
esttab logit_InParty_H1_1 logit_InParty_H1_2 logit_InParty_H1_3 logit_OutParty_H1_1 logit_OutParty_H1_2 logit_OutParty_H1_3 using Tables/Appendix/TableA3_1.tex, replace b(%12.3f) se(%12.3f) ///
starlevels(* 0.10 ** 0.05 *** 0.01) stats(N r2_a, fmt(0 2) labels(N "Adj. R2")) ///
title("Marginal effects from multinomial logistic regressions on player 1 type in BoS.") order(Invasion_Condition Disagreement_Condition) varlabels(_cons Constant Invasion_Condition Invasion Condition Disagreement_Condition DisagreementCondition) addnotes("Standard errors calculated using Delta method in parentheses.") coeflabels(`e(labels)')

*Estimate and store column 1 (bottom panel) regression
logit P1_InParty i.Invasion_Condition if Control_Condition==0 , robust
margins, dydx(Invasion_Condition) atmeans post
eststo logit_InParty_H3_1
*Estimate and store column 2 (bottom panel) regression
logit P1_InParty i.Invasion_Condition $controls1_logit if Control_Condition==0 , robust
margins, dydx(Invasion_Condition) atmeans post
eststo logit_InParty_H3_2
*Estimate and store column 3 (bottom panel) regression
logit P1_InParty i.Invasion_Condition $controls2_logit if Control_Condition==0 , robust
margins, dydx(Invasion_Condition) atmeans post
eststo logit_InParty_H3_3
*Estimate and store column 4 (bottom panel) regression
logit P1_OutParty i.Invasion_Condition if Control_Condition==0 , robust
margins, dydx(Invasion_Condition) atmeans post
eststo logit_OutParty_H3_1
*Estimate and store column 5 (bottom panel) regression
logit P1_OutParty i.Invasion_Condition $controls1_logit if Control_Condition==0 , robust
margins, dydx(Invasion_Condition) atmeans post
eststo logit_OutParty_H3_2
*Estimate and store column 6 (bottom panel) regression
logit P1_OutParty i.Invasion_Condition $controls2_logit if Control_Condition==0 , robust
margins, dydx(Invasion_Condition) atmeans post
eststo logit_OutParty_H3_3

*Combine regression outputs and export
esttab logit_InParty_H3_1 logit_InParty_H3_2 logit_InParty_H3_3 logit_OutParty_H3_1 logit_OutParty_H3_2 logit_OutParty_H3_3 using Tables/Appendix/TableA3_2.tex, replace b(%12.3f) se(%12.3f) ///
starlevels(* 0.10 ** 0.05 *** 0.01) stats(N r2_a, fmt(0 2) labels(N "Adj. R2")) ///
title("Marginal effects from multinomial logistic regressions on player 1 type in BoS.") order(Invasion_Condition Disagreement_Condition) varlabels(_cons Constant Invasion_Condition Invasion Condition Disagreement_Condition DisagreementCondition) addnotes("Standard errors calculated using Delta method in parentheses.") coeflabels(`e(labels)')

eststo clear

********************************************************************************
*** MULTIPLE HYPOTHESIS TESTING
********************************************************************************

*This implements the multiple hypothesis test referred to in A.3.7 (note that simulated numbers may deviate slightly from those in the paper)

rwolf2 (reg AP_FT Invasion_Condition $controls2 if Disagreement_Condition==0, robust) (reg AP_FT Invasion_Condition $controls2 if Control_Condition==0, robust) (reg AP_FT Disagreement_Condition $controls2 if Control_Condition==0, robust), indepvars(Invasion_Condition, Invasion_Condition, Disagreement_Condition) reps(1000) onesided("positive")

********************************************************************************
*** ALL ADDITIONAL RESULTS IN THE PAPER 
********************************************************************************

*Manipulation check tests (ttest and Fisher's)
ttest Threat_Perception if Disagreement_Condition==0, by(Invasion_Condition)
ttest Disagreement_Perception if Disagreement_Condition==0, by(Invasion_Condition)
gen High_Threat=0
replace High_Threat=1 if Threat_Perception>3
tab High_Threat if Invasion_Condition==1, freq
tab High_Threat if Control_Condition==1, freq
tab High_Threat Invasion_Condition if Disagreement_Condition==0
tabi 262 214\208 242

ttest Threat_Perception if Control_Condition==0, by(Invasion_Condition)
ttest Disagreement_Perception if Control_Condition==0, by(Invasion_Condition)	
gen High_Disagreement=0
replace High_Disagreement=1 if Disagreement_Perception>3
tab High_Disagreement if Invasion_Condition==1, freq
tab High_Disagreement if Disagreement_Condition==1, freq
tab High_Disagreement Disagreement_Condition if Control_Condition==0
tabi 294 226\162 251

//Control vs. Disagreement comparison

*FT
reg AP_FT Disagreement_Condition if Invasion_Condition==0, robust

reg AP_FT Disagreement_Condition $controls1 if Invasion_Condition==0, robust

reg AP_FT Disagreement_Condition $controls2 if Invasion_Condition==0, robust

ranksum AP_FT if Invasion_Condition==0, by(Disagreement_Condition)

*aBoS
tab P1_InParty if Disagreement_Condition==1, freq
tab P1_InParty if Control_Condition==1, freq
tab P1_InParty Disagreement_Condition if Invasion_Condition==0
tabi 262 250\208 227
tab P1_OutParty if Disagreement_Condition==1, freq
tab P1_OutParty if Control_Condition==1, freq
tab P1_OutParty Disagreement_Condition if Invasion_Condition==0
tabi 300 288\170 189

logit P1_InParty i.Disagreement_Condition if Invasion_Condition==0 , robust
margins, dydx(Disagreement_Condition) atmeans post

logit P1_InParty i.Disagreement_Condition $controls1_logit if Invasion_Condition==0 , robust
margins, dydx(Disagreement_Condition) atmeans post

logit P1_InParty i.Disagreement_Condition $controls2_logit if Invasion_Condition==0 , robust
margins, dydx(Disagreement_Condition) atmeans post

logit P1_OutParty i.Disagreement_Condition if Invasion_Condition==0 , robust
margins, dydx(Disagreement_Condition) atmeans post

logit P1_OutParty i.Disagreement_Condition $controls1_logit if Invasion_Condition==0 , robust
margins, dydx(Disagreement_Condition) atmeans post

logit P1_OutParty i.Disagreement_Condition $controls2_logit if Invasion_Condition==0 , robust
margins, dydx(Disagreement_Condition) atmeans post

mlogit P1_Type i.Disagreement_Condition if Invasion_Condition==0, base(1) robust
margins, dydx(i.Disagreement_Condition) atmeans post

mlogit P1_Type i.Disagreement_Condition $controls1_logit if Invasion_Condition==0, base(1) robust
margins, dydx(i.Disagreement_Condition) atmeans post

mlogit P1_Type i.Disagreement_Condition $controls2_logit if Invasion_Condition==0, base(1)	robust
margins, dydx(i.Disagreement_Condition) atmeans post

//Test for order effects in aBoS 

*Case with player 2 identifying with the same party as player 1:  
gen P1Dec_P2Own_OwnFirst_num=.
replace	P1Dec_P2Own_OwnFirst_num=1 if P1Dec_P2Dem_Demfirst=="B" & Democrat==1
replace	P1Dec_P2Own_OwnFirst_num=1 if P1Dec_P2Rep_Repfirst=="B" & Republican==1
replace	P1Dec_P2Own_OwnFirst_num=0 if P1Dec_P2Dem_Demfirst=="A" & Democrat==1
replace	P1Dec_P2Own_OwnFirst_num=0 if P1Dec_P2Rep_Repfirst=="A" & Republican==1
gen P1Dec_P2Own_OwnLast_num=.
replace P1Dec_P2Own_OwnLast_num=1 if P1Dec_P2Dem_Demlast=="B" & Democrat==1
replace P1Dec_P2Own_OwnLast_num=1 if P1Dec_P2Rep_Replast=="B" & Republican==1
replace P1Dec_P2Own_OwnLast_num=0 if P1Dec_P2Dem_Demlast=="A" & Democrat==1
replace P1Dec_P2Own_OwnLast_num=0 if P1Dec_P2Rep_Replast=="A" & Republican==1

gen P1Dec_P2Own=max(P1Dec_P2Own_OwnFirst_num, P1Dec_P2Own_OwnLast_num)
tab P1Dec_P2Own

gen P1Dec_P2Own_Order=""
replace P1Dec_P2Own_Order="First" if P1Dec_P2Own_OwnFirst_num!=.
replace P1Dec_P2Own_Order="Last" if P1Dec_P2Own_OwnLast_num!=.
tab P1Dec_P2Own_Order

tab P1Dec_P2Own P1Dec_P2Own_Order
tabi 365 377\329 332
	
*Case with player 2 identifying with the opposite party of player 1: 
gen P1Dec_P2Opposite_OppFirst_num=. 
replace P1Dec_P2Opposite_OppFirst_num=1 if P1Dec_P2Dem_Demfirst=="B" & Republican==1
replace P1Dec_P2Opposite_OppFirst_num=1 if P1Dec_P2Rep_Repfirst=="B" & Democrat==1
replace P1Dec_P2Opposite_OppFirst_num=0 if P1Dec_P2Dem_Demfirst=="A" & Republican==1
replace P1Dec_P2Opposite_OppFirst_num=0 if P1Dec_P2Rep_Repfirst=="A" & Democrat==1
gen P1Dec_P2Opposite_OppLast_num=. 
replace P1Dec_P2Opposite_OppLast_num=1 if P1Dec_P2Dem_Demlast=="B" & Republican==1
replace P1Dec_P2Opposite_OppLast_num=1 if P1Dec_P2Rep_Replast=="B" & Democrat==1
replace P1Dec_P2Opposite_OppLast_num=0 if P1Dec_P2Dem_Demlast=="A" & Republican==1
replace P1Dec_P2Opposite_OppLast_num=0 if P1Dec_P2Rep_Replast=="A" & Democrat==1

gen P1Dec_P2Opp=max(P1Dec_P2Opposite_OppFirst_num, P1Dec_P2Opposite_OppLast_num)
tab P1Dec_P2Opp

gen P1Dec_P2Opposite_Order=""
replace P1Dec_P2Opposite_Order="First" if P1Dec_P2Opposite_OppFirst_num!=.
replace P1Dec_P2Opposite_Order="Last" if P1Dec_P2Opposite_OppLast_num!=.
tab P1Dec_P2Opposite_Order

tab P1Dec_P2Opp P1Dec_P2Opposite_Order
tabi 426 426\283 268	
	
//Stereotypes analysis

*Descriptive ttest
	*Patriotic 		
ttest Patriotic_InParty==Patriotic_OutParty
ttest Dem_Patriotic==Rep_Patriotic if Democrat==1
ttest Dem_Patriotic==Rep_Patriotic if Republican==1	

	*Selfish
ttest Selfish_InParty==Selfish_OutParty
ttest Dem_Selfish==Rep_Selfish if Democrat==1
ttest Dem_Selfish==Rep_Selfish if Republican==1	
	
	*Intelligent
ttest Intelligent_InParty==Intelligent_OutParty
ttest Dem_Intelligent==Rep_Intelligent if Democrat==1
ttest Dem_Intelligent==Rep_Intelligent if Republican==1	

	*Openminded
ttest Openminded_InParty==Openminded_OutParty
ttest Dem_Openminded==Rep_Openminded if Democrat==1
ttest Dem_Openminded==Rep_Openminded if Republican==1		
	
	*Honest
ttest Honest_InParty==Honest_OutParty
ttest Dem_Honest==Rep_Honest if Democrat==1
ttest Dem_Honest==Rep_Honest if Republican==1	
	
*Regressions and MWU test (treatment effects)	
	*Invasion vs. Control comparison
reg AP_Patriotic Invasion_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Disagreement_Condition==0

reg AP_Selfish Invasion_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Disagreement_Condition==0

reg AP_Intelligent Invasion_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Disagreement_Condition==0

reg AP_Openminded Invasion_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Disagreement_Condition==0

reg AP_Honest Invasion_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Disagreement_Condition==0

ranksum AP_Patriotic if Disagreement_Condition==0, by(Invasion_Condition)
ranksum AP_Selfish if Disagreement_Condition==0, by(Invasion_Condition)	
ranksum AP_Intelligent if Disagreement_Condition==0, by(Invasion_Condition)
ranksum AP_Openminded if Disagreement_Condition==0, by(Invasion_Condition)
ranksum AP_Honest if Disagreement_Condition==0, by(Invasion_Condition)

	*Disagreement vs.Control comparison
reg AP_Patriotic Disagreement_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Invasion_Condition==0

reg AP_Selfish Disagreement_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Invasion_Condition==0

reg AP_Intelligent Disagreement_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Invasion_Condition==0

reg AP_Openminded Disagreement_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Invasion_Condition==0

reg AP_Honest Disagreement_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Invasion_Condition==0

ranksum AP_Patriotic if Invasion_Condition==0, by(Disagreement_Condition)
ranksum AP_Selfish if Invasion_Condition==0, by(Disagreement_Condition)
ranksum AP_Intelligent if Invasion_Condition==0, by(Disagreement_Condition)
ranksum AP_Openminded if Invasion_Condition==0, by(Disagreement_Condition)
ranksum AP_Honest if Invasion_Condition==0, by(Disagreement_Condition)

	*Disagreement vs. Invasion comparison
reg AP_Patriotic Disagreement_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Control_Condition==0

reg AP_Selfish Disagreement_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Control_Condition==0

reg AP_Intelligent Disagreement_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Control_Condition==0

reg AP_Openminded Disagreement_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Control_Condition==0

reg AP_Honest Disagreement_Condition Age Male White Schooling_Rank Employed Political_Interest StrongSupporter Democrat Following_Invasion if Control_Condition==0

ranksum AP_Patriotic if Control_Condition==0, by(Disagreement_Condition)
ranksum AP_Selfish if Control_Condition==0, by(Disagreement_Condition)
ranksum AP_Intelligent if Control_Condition==0, by(Disagreement_Condition)
ranksum AP_Openminded if Control_Condition==0, by(Disagreement_Condition)
ranksum AP_Honest if Control_Condition==0, by(Disagreement_Condition)

//Heterogeneous treatment effects by partisan affiliation 

*Manipulation check 
ttest Threat_Perception if Disagreement_Condition==0 & Democrat==0, by(Invasion_Condition)
ttest Threat_Perception if Disagreement_Condition==0 & Democrat==1, by(Invasion_Condition)
ttest Disagreement_Perception if Control_Condition==0 & Democrat==0, by(Invasion_Condition)
ttest Disagreement_Perception if Control_Condition==0 & Democrat==1, by(Invasion_Condition)

*FT regressions 
reg AP_FT Invasion_Condition if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls1 if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls1 Political_Interest StrongSupporter if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls1 if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls1 Political_Interest StrongSupporter if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls1 if Control_Condition==0 & Democrat==1, robust	

reg AP_FT Invasion_Condition $controls1 Political_Interest StrongSupporter if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition if Control_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls1 if Control_Condition==0 & Democrat==0, robust	

reg AP_FT Invasion_Condition $controls1 Political_Interest StrongSupporter if Control_Condition==0 & Democrat==0, robust

reg AP_FT Disagreement_Condition $controls1 Political_Interest StrongSupporter if Invasion_Condition==0 & Democrat==1, robust

reg AP_FT Disagreement_Condition $controls1 Political_Interest StrongSupporter if Invasion_Condition==0 & Democrat==0, robust

*aBoS logit regressions 
logit P1_InParty i.Invasion_Condition $controls2_logit if Disagreement_Condition==0 & Democrat==0, robust
margins, dydx(Invasion_Condition) atmeans post

logit P1_OutParty i.Invasion_Condition $controls2_logit if Disagreement_Condition==0 & Democrat==0, robust
margins, dydx(Invasion_Condition) atmeans post

logit P1_InParty i.Invasion_Condition $controls2_logit if Disagreement_Condition==0 & Democrat==1, robust
margins, dydx(Invasion_Condition) atmeans post

logit P1_OutParty i.Invasion_Condition $controls2_logit if Disagreement_Condition==0 & Democrat==1, robust
margins, dydx(Invasion_Condition) atmeans post

*aBoS treatment effects on 'Player 1 type' (mlogit regressions)
mlogit P1_Type i.Invasion_Condition Age i.Male i.White Schooling_Rank i.Employed Political_Interest i.StrongSupporter Following_Invasion if Disagreement_Condition==0 & Democrat==0, base(1)
margins, dydx(i.Invasion_Condition) atmeans post
mlogit P1_Type i.Invasion_Condition Age i.Male i.White Schooling_Rank i.Employed Political_Interest i.StrongSupporter Following_Invasion if Disagreement_Condition==0 & Democrat==1, base(1)
margins, dydx(i.Invasion_Condition) atmeans post

mlogit P1_Type i.Invasion_Condition Age i.Male i.White Schooling_Rank i.Employed Political_Interest i.StrongSupporter Following_Invasion if Control_Condition==0 & Democrat==0, base(1)
margins, dydx(i.Invasion_Condition) atmeans post
mlogit P1_Type i.Invasion_Condition Age i.Male i.White Schooling_Rank i.Employed Political_Interest i.StrongSupporter Following_Invasion if Control_Condition==0 & Democrat==1, base(1)
margins, dydx(i.Invasion_Condition) atmeans post
	
*Fade out of primes: 
destring FTDemRep_FirstClick, replace
destring FTRepDem_FirstClick, replace
count if FTDemRep_FirstClick!=.
count if FTRepDem_FirstClick!=.

gen After_Prime=max(FTDemRep_FirstClick, FTRepDem_FirstClick)
sum After_Prime, detail
gen Slow=0
replace Slow=1 if After_Prime>14.7

destring Demographics_FirstClick, replace 
destring Demographics_LastClick, replace
gen TimeSpent_Demo=Demographics_LastClick-Demographics_FirstClick
sum TimeSpent_Demo, detail

gen Int_Temp=Invasion_Condition*After_Prime

reg AP_FT Invasion_Condition After_Prime Int_Temp TimeSpent_Demo if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition After_Prime Int_Temp TimeSpent_Demo $controls1 if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition After_Prime Int_Temp TimeSpent_Demo $controls2 if Disagreement_Condition==0, robust

drop Int_Temp

gen Int_Temp=Invasion_Condition*After_Prime

reg AP_FT Invasion_Condition After_Prime Int_Temp TimeSpent_Demo if Control_Condition==0, robust

reg AP_FT Invasion_Condition After_Prime Int_Temp TimeSpent_Demo $controls1 if Control_Condition==0, robust

reg AP_FT Invasion_Condition After_Prime Int_Temp TimeSpent_Demo $controls2 if Control_Condition==0, robust

drop Int_Temp

//Strong Supporter moderation effect: 

*Results on entire sample
tab StrongSupporter
ttest FT_InParty, by(StrongSupporter)
ttest FT_OutParty, by(StrongSupporter)

gen int_temp=StrongSupporter*Invasion_Condition

reg AP_FT Invasion_Condition StrongSupporter int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition $controls1 StrongSupporter int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Disagreement_Condition==0, robust

drop int_temp 

gen int_temp=StrongSupporter*Invasion_Condition

reg AP_FT Invasion_Condition StrongSupporter int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition $controls1 StrongSupporter int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Control_Condition==0, robust

drop int_temp

*Results on Democrats and Republicans separately
gen int_temp=StrongSupporter*Invasion_Condition

reg AP_FT Invasion_Condition StrongSupporter int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls1 StrongSupporter int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition StrongSupporter int_temp if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls1 StrongSupporter int_temp if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Disagreement_Condition==0 & Democrat==0, robust

drop int_temp

gen int_temp=StrongSupporter*Invasion_Condition

reg AP_FT Invasion_Condition StrongSupporter int_temp if Control_Condition ==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls1 StrongSupporter int_temp if Control_Condition ==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Control_Condition ==0 & Democrat==1, robust

reg AP_FT Invasion_Condition StrongSupporter int_temp if Control_Condition ==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls1 StrongSupporter int_temp if Control_Condition ==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Control_Condition ==0 & Democrat==0, robust

drop int_temp

//Political interested moderation effect: 

*Results on entire sample
gen Political_Interested=0
replace Political_Interested=1 if Political_Interest>3
tab Political_Interested

gen int_temp=Political_Interested*Invasion_Condition

reg AP_FT Invasion_Condition Political_Interested int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition $controls1 Political_Interested int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Disagreement_Condition==0, robust

drop int_temp 

gen int_temp=Political_Interested*Invasion_Condition

reg AP_FT Invasion_Condition Political_Interested int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition $controls1 Political_Interested int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Control_Condition==0, robust

drop int_temp

*Results on Democrats and Republicans separately 
gen int_temp=Political_Interested*Invasion_Condition

reg AP_FT Invasion_Condition Political_Interested int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls1 Political_Interested int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Political_Interested int_temp if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls1 Political_Interested int_temp if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Disagreement_Condition==0 & Democrat==0, robust

drop int_temp

gen int_temp=Political_Interested*Invasion_Condition

reg AP_FT Invasion_Condition Political_Interested int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls1 Political_Interested int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Political_Interested int_temp if Control_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls1 Political_Interested int_temp if Control_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Control_Condition==0 & Democrat==0, robust

drop int_temp

//Age moderation effect

*Generate variables
gen Over30=0
replace Over30=1 if Age>30
tab Over30
gen Over40=0
replace Over40=1 if Age>40
tab Over40

*Results on entire sample
ttest AP_FT, by(Over30)
ttest AP_FT, by(Over40)

gen int_temp=Over30*Invasion_Condition

reg AP_FT Invasion_Condition Over30 int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition Over30 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition Over30 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed Political_Interest StrongSupporter Democrat int_temp if Disagreement_Condition==0, robust

drop int_temp 

gen int_temp=Over30*Invasion_Condition

reg AP_FT Invasion_Condition Over30 int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition Over30 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition Over30 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed Political_Interest StrongSupporter int_temp if Control_Condition==0, robust

drop int_temp

gen int_temp=Over40*Invasion_Condition
reg AP_FT Invasion_Condition Over40 int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition Over40 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition Over40 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed Political_Interest StrongSupporter Democrat int_temp if Disagreement_Condition==0, robust

drop int_temp 

gen int_temp=Over40*Invasion_Condition

reg AP_FT Invasion_Condition Over40 int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition Over40 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition Over40 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed Political_Interest StrongSupporter int_temp if Control_Condition==0, robust

drop int_temp

*Results on Democrats and Republicans separately

gen int_temp=Over30*Invasion_Condition

reg AP_FT Invasion_Condition Over30 int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Over30 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Over30 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed Political_Interest StrongSupporter Democrat int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Over30 int_temp if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition Over30 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed int_temp if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition Over30 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed Political_Interest StrongSupporter Democrat int_temp if Disagreement_Condition==0 & Democrat==0, robust

drop int_temp

gen int_temp=Over30*Invasion_Condition

reg AP_FT Invasion_Condition Over30 int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Over30 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Over30 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed Political_Interest StrongSupporter Democrat int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Over30 int_temp if Control_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition Over30 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed int_temp if Control_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition Over30 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed Political_Interest StrongSupporter Democrat int_temp if Control_Condition==0 & Democrat==0, robust

drop int_temp

gen int_temp=Over40*Invasion_Condition

reg AP_FT Invasion_Condition Over40 int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Over40 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Over40 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed Political_Interest StrongSupporter Democrat int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Over40 int_temp if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition Over40 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed int_temp if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition Over40 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed Political_Interest StrongSupporter Democrat int_temp if Disagreement_Condition==0 & Democrat==0, robust

drop int_temp

gen int_temp=Over40*Invasion_Condition

reg AP_FT Invasion_Condition Over40 int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Over40 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Over40 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed Political_Interest StrongSupporter Democrat int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Over40 int_temp if Control_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition Over40 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed int_temp if Control_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition Over40 Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Schoolingdum1 Schoolingdum3 Schoolingdum4 Schoolingdum5 Schoolingdum6 Schoolingdum7 Employed Political_Interest StrongSupporter Democrat int_temp if Control_Condition==0 & Democrat==0, robust

drop int_temp

//Gender moderation effect

*Results on entire sample 
tab Male
ttest Threat_Perception, by(Male)
ttest AP_FT, by(Male)

gen int_temp=Male*Invasion_Condition

reg AP_FT Invasion_Condition Male int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition $controls1 int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Disagreement_Condition==0, robust

drop int_temp 

gen int_temp=Male*Invasion_Condition

reg AP_FT Invasion_Condition Male int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition $controls1 int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Control_Condition==0, robust

drop int_temp

*Results on Democrats and Republicans separately

gen int_temp=Male*Invasion_Condition

reg AP_FT Invasion_Condition Male int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls1 int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Male int_temp if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls1 int_temp if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Disagreement_Condition==0 & Democrat==0, robust

drop int_temp

gen int_temp=Male*Invasion_Condition

reg AP_FT Invasion_Condition Male int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls1 int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Male int_temp if Control_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls1 int_temp if Control_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Control_Condition==0 & Democrat==0, robust

drop int_temp

//Education-level moderation effects

*Results on entire sample  
sum Schoolingdum*
gen Highly_Educated=0
replace Highly_Educated=1 if Schoolingdum2==1
replace Highly_Educated=1 if Schoolingdum6==1
replace Highly_Educated=1 if Schoolingdum3==1
sum Highly_Educated

gen int_temp=Highly_Educated*Invasion_Condition

reg AP_FT Invasion_Condition Highly_Educated int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition Highly_Educated Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Employed int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Employed Political_Interest StrongSupporter Democrat Highly_Educated int_temp if Disagreement_Condition==0, robust

drop int_temp 

gen int_temp=Highly_Educated*Invasion_Condition

reg AP_FT Invasion_Condition Highly_Educated int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition Highly_Educated Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Employed int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Employed Political_Interest StrongSupporter Highly_Educated int_temp if Control_Condition==0, robust

drop int_temp
	
*Result on Democrats and Republicans separately
gen int_temp=Highly_Educated*Invasion_Condition

reg AP_FT Invasion_Condition Highly_Educated int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Employed Highly_Educated int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Employed Political_Interest StrongSupporter Democrat Highly_Educated int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Highly_Educated int_temp if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Employed int_temp Highly_Educated if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Employed Political_Interest StrongSupporter Democrat Highly_Educated int_temp if Disagreement_Condition==0 & Democrat==0, robust

drop int_temp

gen int_temp=Highly_Educated*Invasion_Condition

reg AP_FT Invasion_Condition Highly_Educated int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Employed Highly_Educated int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Employed Political_Interest StrongSupporter Democrat Highly_Educated int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Highly_Educated int_temp if Control_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Employed int_temp Highly_Educated if Control_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition Age Male Ethnicitydum1 Ethnicitydum2 Ethnicitydum3 Ethnicitydum4 Employed Political_Interest StrongSupporter Democrat Highly_Educated int_temp if Control_Condition==0 & Democrat==0, robust

drop int_temp

//Followers/Non-followers moderation effects

*Results on entire sample 
gen Following=0
replace Following=1 if Following_Invasion>3
tab Following
label define follabel 0 "Non-Followers" 1 "Followers"
label values Following follabel

gen int_temp=Following*Invasion_Condition

reg AP_FT Invasion_Condition Following int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition Following $controls1 int_temp if Disagreement_Condition==0, robust

reg AP_FT Invasion_Condition $controls2 Following int_temp if Disagreement_Condition==0, robust

drop int_temp 

gen int_temp=Following*Invasion_Condition

reg AP_FT Invasion_Condition Following int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition Following $controls1 int_temp if Control_Condition==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Control_Condition==0, robust

drop int_temp

*Results on Democrats and Republicans separately
gen int_temp=Following*Invasion_Condition

reg AP_FT Invasion_Condition Following int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls1 Following int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Disagreement_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Following int_temp if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls1 int_temp Following if Disagreement_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Disagreement_Condition==0 & Democrat==0, robust

drop int_temp

gen int_temp=Following*Invasion_Condition

reg AP_FT Invasion_Condition Following int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls1 Following int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Control_Condition==0 & Democrat==1, robust

reg AP_FT Invasion_Condition Following int_temp if Control_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls1 int_temp Following if Control_Condition==0 & Democrat==0, robust

reg AP_FT Invasion_Condition $controls2 int_temp if Control_Condition==0 & Democrat==0, robust

drop int_temp

*Close log
log close
